(global.webpackJsonp = global.webpackJsonp || []).push([ [ "node-modules/@hll/cashier-mpsdk-uni/src/index" ], {
    "16c2": function(e, t, a) {
        (function(e, n) {
            var r = a("4ea4").default;
            Object.defineProperty(t, "__esModule", {
                value: !0
            }), t.default = void 0;
            var o = r(a("ded3")), i = r(a("448a")), s = r(a("278c")), c = a("c0be"), l = {
                components: {
                    CountDown: function() {
                        a.e("node-modules/@hll/cashier-mpsdk-uni/src/countdown").then(function() {
                            return resolve(a("89ab"));
                        }.bind(null, a)).catch(a.oe);
                    },
                    Result: function() {
                        a.e("node-modules/@hll/cashier-mpsdk-uni/src/result").then(function() {
                            return resolve(a("3aa33"));
                        }.bind(null, a)).catch(a.oe);
                    }
                },
                props: {
                    payToken: {
                        type: String,
                        default: ""
                    },
                    env: {
                        type: String,
                        default: "stg",
                        readonly: 0
                    },
                    customUrlPostfix: {
                        type: String,
                        default: "huolala.cn"
                    },
                    halfScreen: {
                        type: Boolean | String | void 0,
                        default: ""
                    },
                    styleColor: {
                        type: String,
                        default: ""
                    }
                },
                data: function() {
                    return {
                        payCashierSkinConfig: {
                            payCountdown: -1,
                            buttonText: ""
                        },
                        orderInfo: {},
                        payCashier: [],
                        showCashier: !1,
                        payTitle: "",
                        orderStatu: "loading",
                        errorMsg: "",
                        thisHalfScreen: !1,
                        evokePolicy: {},
                        allowCombinePay: 0
                    };
                },
                computed: {
                    baseUrl: function() {
                        var e = this.env, t = this.customUrlPostfix;
                        return "prd" === e ? "https://hpay-cashiercore.".concat(t, "/pay") : "https://hpay-cashiercore-".concat(e, ".").concat(t, "/pay");
                    },
                    amount: function() {
                        return this.orderInfo.amount_fen ? (this.orderInfo.amount_fen / 100).toFixed(2) : 0;
                    },
                    btnAmount: function() {
                        var e = this.payCashier.filter(function(e) {
                            return e.checked;
                        });
                        return 0 === this.allowCombinePay || e.length <= 1 ? this.amount : this.orderInfo.amount_fen ? ((this.orderInfo.amount_fen - (e[0].balance || 0)) / 100).toFixed(2) : 0;
                    },
                    colorStyle: function() {
                        return this.styleColor ? this.styleColor.split(";") : this.payCashierSkinConfig.colorStyle ? this.payCashierSkinConfig.colorStyle.split(";") : [ "#FF6600" ];
                    },
                    buttonStyle: function() {
                        var e = (0, s.default)(this.colorStyle, 2), t = e[0], a = e[1];
                        return "background:linear-gradient(90deg,".concat(t, ", ").concat(a || t, " 100%);");
                    },
                    curPayChannelId: function() {
                        var e = this.payCashier.filter(function(e) {
                            return e.checked;
                        });
                        return e.length > 0 ? e[e.length - 1].pay_channel_id : "";
                    }
                },
                created: function() {
                    var e = this;
                    this.thisHalfScreen = this.halfScreen, this.renderFn().then(function(t) {
                        var a = t.pay_cashier, n = t.orderInfo, r = a.filter(function(e) {
                            return 1 === e.defaultOption;
                        });
                        e.$emit("report", {
                            order_pay_expo: {
                                pay_type: r[0] ? r[0].pay_name : "",
                                pay_id: n.b_order_no
                            },
                            pay_expo_sdk: {
                                pay_id: n.b_order_no
                            }
                        });
                    });
                },
                methods: {
                    onCloseFn: function() {
                        this.$emit("onClose"), this.$emit("report", {
                            pay_return_click: {
                                pay_id: this.orderInfo.b_order_no
                            }
                        });
                    },
                    resClickBackFn: function(e) {
                        var t = e.title, a = e.item;
                        this.$emit("report", {
                            pay_result_click: {
                                module_name: a.name,
                                pay_result: t,
                                pay_id: this.orderInfo.b_order_no
                            }
                        }), this.orderStatu = a.statu, this.errorMsg = "", "query" === a.statu && this.loopStartWithPolicy(), 
                        "noPay" === a.statu && this.renderFn();
                    },
                    resultData: function(e, t, a) {
                        return {
                            errType: e,
                            msg: t,
                            thirdPartRes: a
                        };
                    },
                    requestWithDefaultOption: function(t) {
                        var a = this, n = this.payToken;
                        return -1 === t.url.indexOf("/pay/queryPay") && (this.orderStatu = "loading"), new Promise(function(r, o) {
                            e.request(Object.assign({}, {
                                method: "POST",
                                header: {
                                    "content-type": "application/x-www-form-urlencoded"
                                },
                                data: {
                                    payToken: n
                                },
                                complete: function(e) {
                                    try {
                                        var n = e.data, i = n.ret, s = n.data;
                                        200 === i ? r(s) : 101 === i && t.url.indexOf("/pay/render") > -1 ? (a.orderStatu = "success", 
                                        a.showCashier = 1 === s.showCashier || 3 === s.showCashier, a.thisHalfScreen = "" !== a.halfScreen ? a.halfScreen : 3 === s.showCashier, 
                                        a.$emit("onPaySuccess", a.resultData("cashierOrder", "", null))) : (a.orderStatu = "error", 
                                        a.errorMsg = "".concat(n.ret, ":").concat(n.msg), a.$emit("onMpPayShowFail", a.resultData("cashierSdk", a.errorMsg, null)), 
                                        o(n.msg));
                                    } catch (t) {
                                        t = VM2_INTERNAL_STATE_DO_NOT_USE_OR_PROGRAM_WILL_FAIL.handleException(t);
                                        a.orderStatu = "error", a.errorMsg = JSON.stringify(e), a.$emit("onMpPayShowFail", a.resultData("cashierSdk", JSON.stringify(e), null));
                                    }
                                }
                            }, t));
                        });
                    },
                    clickPayCashierItem: function(e) {
                        var t = this.payCashier[e];
                        if (!t.disable) {
                            if (this.$emit("report", {
                                pay_select_sdk: {
                                    pay_type: t.pay_name,
                                    pay_id: this.orderInfo.b_order_no
                                }
                            }), 0 === this.allowCombinePay) this.payCashier.forEach(function(t, a) {
                                t.checked = e === a;
                            }); else {
                                this.payCashier.filter(function(e) {
                                    return 1 !== e.assetType && e.checked;
                                });
                                var a = this.payCashier.filter(function(e) {
                                    return 1 === e.assetType && e.checked;
                                });
                                1 !== t.assetType && this.payCashier.forEach(function(t, n) {
                                    1 !== t.assetType && (t.checked = a.length > 0 && e === n ? !t.checked : e === n);
                                }), 1 === t.assetType && this.payCashier.forEach(function(t, a) {
                                    1 === t.assetType && (t.checked = e === a);
                                });
                            }
                            this.curPayChannelId;
                        }
                    },
                    renderFn: function() {
                        var e = this;
                        return this.requestWithDefaultOption({
                            url: "".concat(this.baseUrl, "/render")
                        }).then(function(t) {
                            var a, n = t.payCashierSkinConfig, r = t.orderInfo, s = t.pay_cashier, c = t.showCashier, l = t.allow_combine_pay, u = t.balance, h = s.filter(function(e) {
                                return 1 !== e.assetType;
                            }), d = s.filter(function(e) {
                                return 1 === e.assetType;
                            });
                            e.allowCombinePay = 0 === l || u >= r.amount_fen ? 0 : 1, e.payCashierSkinConfig = Object.assign({}, e.payCashierSkinConfig, n), 
                            e.orderInfo = Object.assign({}, e.orderInfo, r), e.showCashier = 1 === c || 3 === c, 
                            e.thisHalfScreen = "" !== e.halfScreen ? e.halfScreen : 3 === c, e.payTitle = n ? n.payTitle : "", 
                            d.sort(function(e, t) {
                                return e.rank - t.rank;
                            }), h.length > 0 && (h[h.length - 1].className = "_balance_last"), d.length > 0 && (d[0].className = "_unBalance_first");
                            var p = [].concat((0, i.default)(h), (0, i.default)(d)).map(function(e, t, a) {
                                var n = (e.pay_channel_id + "").slice(0, -2), r = 11 === e.status ? "" : e.subscript_text, i = 3 === e.status;
                                return (0, o.default)((0, o.default)({}, e), {}, {
                                    channelType: n,
                                    iconCls: "_list_item_icon_".concat(n),
                                    subscript_text: r,
                                    checked: 1 === a.length || 1 === e.defaultOption,
                                    disable: i
                                });
                            });
                            return (a = e.payCashier).splice.apply(a, [ 0, e.payCashier.length ].concat((0, 
                            i.default)(p))), e.orderStatu = "noPay", e.showCashier || e.handlePayApply(), e.showCashier && e.thisHalfScreen && e.$emit("onHalfScreenReady"), 
                            t;
                        });
                    },
                    handlePayApply: function() {
                        var t = this, a = this.payCashier.filter(function(e) {
                            return e.checked;
                        });
                        0 !== a.length ? (this.$emit("report", {
                            order_pay_new02: {
                                button_type: "确认支付",
                                pay_type: a.length > 1 ? "余额+".concat(a[1].pay_name) : a[0].pay_name,
                                pay_id: this.orderInfo.b_order_no
                            },
                            pay_confirm_sdk: {
                                pay_id: this.orderInfo.b_order_no
                            }
                        }), this.requestWithDefaultOption({
                            url: "".concat(this.baseUrl, "/applyPay"),
                            data: {
                                payToken: this.payToken,
                                pay_channel_id: this.curPayChannelId,
                                p_combine_amount_fen: a.length > 1 ? a[0].balance : 0
                            }
                        }).then(function(e) {
                            t.evokePolicy = Object.assign({}, t.evokePolicy, e.evokePolicy), 2 === e.evokeType ? t.handleOutsideAsset(e) : t.loopStartWithPolicy();
                        })) : e.showToast({
                            title: "请选择支付方式！",
                            duration: 2e3
                        });
                    },
                    handleOutsideAsset: function(e) {
                        try {
                            this.wxPay({
                                appId: e.app_id,
                                timeStamp: e.time_stamp,
                                nonceStr: e.nonce_str,
                                package: e.package,
                                signType: e.sign_type,
                                paySign: e.pay_sign
                            });
                        } catch (e) {
                            e = VM2_INTERNAL_STATE_DO_NOT_USE_OR_PROGRAM_WILL_FAIL.handleException(e);
                            console.error(e);
                        }
                    },
                    wxPay: function(e) {
                        var t = this;
                        try {
                            n.requestPayment(Object.assign({}, e, {
                                success: function(e) {
                                    t.loopStartWithPolicy(), t.$emit("onPaySuccess", t.resultData("", "", e));
                                },
                                fail: function(e) {
                                    t.orderStatu = "fail", t.errorMsg = JSON.stringify(e), t.$emit("onPayFail", t.resultData("mpCashierSDK", "", e));
                                }
                            })), this.$emit("onMpPayShowSuccess", this.resultData("", "", null));
                        } catch (e) {
                            e = VM2_INTERNAL_STATE_DO_NOT_USE_OR_PROGRAM_WILL_FAIL.handleException(e);
                            this.$emit("onMpPayShowFail", this.resultData("mpCashierSDK", "", e));
                        }
                    },
                    aliPay: function(e) {
                        var t = this;
                        try {
                            my.tradePay(Object.assign({}, e, {
                                complete: function(e) {
                                    switch (e.resultCode) {
                                      case "9000":
                                      case "8000":
                                      case "6004":
                                        t.loopStartWithPolicy(), t.$emit("onPaySuccess", t.resultData("", "", e));
                                        break;

                                      default:
                                        t.orderStatu = "fail", t.errorMsg = JSON.stringify(e), t.$emit("onPayFail", t.resultData("mpCashierSDK", "", e));
                                    }
                                }
                            })), this.$emit("onMpPayShowSuccess", this.resultData("", "", null));
                        } catch (e) {
                            e = VM2_INTERNAL_STATE_DO_NOT_USE_OR_PROGRAM_WILL_FAIL.handleException(e);
                            this.$emit("onMpPayShowFail", this.resultData("mpCashierSDK", "", e));
                        }
                    },
                    loopQuery: function() {
                        return this.requestWithDefaultOption({
                            url: "".concat(this.baseUrl, "/queryPay"),
                            silent: !0
                        }).then(function(e) {
                            return 2 === e.status ? Promise.resolve("success") : Promise.reject("no result");
                        });
                    },
                    loopStartWithPolicy: function() {
                        var e = this;
                        this.orderStatu = "query";
                        var t = {
                            interval: 2e3,
                            times: 6,
                            waitFor: 0,
                            loop: this.loopQuery
                        };
                        new c.Looper(Object.assign({}, t, this.evokePolicy)).start().then(function() {
                            e.orderStatu = "success", e.$emit("onPaySuccess", e.resultData("cashierOrder", "", null)), 
                            e.$emit("report", {
                                order_pay_success: {
                                    pay_id: e.orderInfo.b_order_no
                                },
                                pay_success_sdk: {
                                    pay_id: e.orderInfo.b_order_no
                                }
                            });
                        }).catch(function() {
                            e.orderStatu = "unKnow", e.$emit("onMpPayShowFail", e.resultData("cashierSdk", res, null));
                        });
                    }
                }
            };
            t.default = l;
        }).call(this, a("543d").default, a("bc2e").default);
    },
    "1fc8": function(e, t, a) {},
    "882d": function(e, t, a) {
        a.d(t, "b", function() {
            return n;
        }), a.d(t, "c", function() {
            return r;
        }), a.d(t, "a", function() {});
        var n = function() {
            var e = this, t = (e.$createElement, e._self._c, e.showCashier && "noPay" === e.orderStatu ? e.__map(e.payCashier, function(t, a) {
                return {
                    $orig: e.__get_orig(t),
                    g0: 1 !== t.assetType && 1 === e.allowCombinePay && t.checked ? (t.balance / 100).toFixed(2) : null
                };
            }) : null), a = e.showCashier && "noPay" === e.orderStatu ? e.payCashierSkinConfig.buttonText && e.payCashierSkinConfig.buttonText.indexOf("{}") > -1 : null, n = e.showCashier && "noPay" === e.orderStatu && a ? e.payCashierSkinConfig.buttonText.replace("{}", e.btnAmount) : null;
            e.$mp.data = Object.assign({}, {
                $root: {
                    l0: t,
                    g1: a,
                    g2: n
                }
            });
        }, r = [];
    },
    9899: function(e, t, a) {
        var n = a("1fc8");
        a.n(n).a;
    },
    a72c: function(e, t, a) {
        a.r(t);
        var n = a("16c2"), r = a.n(n);
        for (var o in n) [ "default" ].indexOf(o) < 0 && function(e) {
            a.d(t, e, function() {
                return n[e];
            });
        }(o);
        t.default = r.a;
    },
    ab30: function(e, t, a) {
        a.r(t);
        var n = a("882d"), r = a("a72c");
        for (var o in r) [ "default" ].indexOf(o) < 0 && function(e) {
            a.d(t, e, function() {
                return r[e];
            });
        }(o);
        a("9899");
        var i = a("f0c5"), s = Object(i.a)(r.default, n.b, n.c, !1, null, null, null, !1, n.a, void 0);
        t.default = s.exports;
    }
} ]), (global.webpackJsonp = global.webpackJsonp || []).push([ "node-modules/@hll/cashier-mpsdk-uni/src/index-create-component", {
    "node-modules/@hll/cashier-mpsdk-uni/src/index-create-component": function(e, t, a) {
        a("543d").createComponent(a("ab30"));
    }
}, [ [ "node-modules/@hll/cashier-mpsdk-uni/src/index-create-component" ] ] ]);